package com.hundsun.cprs.yyt.service.trade.service.impl;

import com.hundsun.cprs.yyt.common.base.BaseService;
import com.hundsun.cprs.yyt.service.trade.dao.TradeCancelFlowDao;
import com.hundsun.cprs.yyt.service.trade.domain.TradeCancelFlow;
import com.hundsun.cprs.yyt.service.trade.domain.query.TradeCancelFlowQuery;
import com.hundsun.cprs.yyt.service.trade.service.TradeCancelFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TradeCancelFlowServiceImpl extends BaseService implements TradeCancelFlowService {
    
    @Autowired
    private TradeCancelFlowDao cancelFlowDao;

    @Override
    public void selectByPage(TradeCancelFlowQuery query) {
        List<TradeCancelFlow> result = cancelFlowDao.selectByQuery(query);
        query.compatible(result);
    }
    
    @Override
    public TradeCancelFlow selectById(Long id) {
         return cancelFlowDao.selectByPrimaryKey(id);
    }

    @Override
    public void createCancelFlow(TradeCancelFlow flow) {
        cancelFlowDao.insert(flow);
    }

    @Override
    public void updateCancelFlow(TradeCancelFlow flow) {
        cancelFlowDao.updateByPrimaryKey(flow);
    }

}
